+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
+Thu Feb 14 16:46:48 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtktextdisplay.c gtk/gtklabel.c
+ gtk/gtkstyle.[ch] gtk/gtkwidget.c: Patch from Bill
+ Haneman and Padraig O'Briain to add cursor_aspect_ratio
+ style property to GtkWidget to allow theming the aspect
+ ratio of the cursor.
+
+ * gtk/gtkentry.c gtk/gtktextview.c gtk/gtklabel.c
+ gtk/gtkwidget.c tests/testgtkrc: Move cursor-color style property
+ to GtkWidget.
+
Thu Feb 14 11:13:22 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_get_surrounding):
"",
G_PARAM_READABLE | G_PARAM_WRITABLE));
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_boxed ("cursor_color",
- _("Cursor color"),
- _("Color with which to draw insertion cursor"),
- GDK_TYPE_COLOR,
- G_PARAM_READABLE));
-
signals[POPULATE_POPUP] =
gtk_signal_new ("populate_popup",
GTK_RUN_LAST,
if (entry->cursor_gc)
gdk_gc_unref (entry->cursor_gc);
- gtk_widget_style_get (GTK_WIDGET (entry), "cursor_color", &cursor_color, NULL);
+ gtk_widget_style_get (GTK_WIDGET (entry), "cursor-color", &cursor_color, NULL);
entry->cursor_gc = gdk_gc_new (entry->text_area);
if (cursor_color)
gdk_gc_set_rgb_fg_color (entry->cursor_gc, cursor_color);
cursor_location.width = 0;
cursor_location.height = text_area_height - 2 * INNER_BORDER ;
- _gtk_draw_insertion_cursor (entry->text_area, gc1,
+ _gtk_draw_insertion_cursor (widget, entry->text_area, gc1,
&cursor_location, dir1);
if (gc2)
{
cursor_location.x = xoffset + x2;
- _gtk_draw_insertion_cursor (entry->text_area, gc2,
+ _gtk_draw_insertion_cursor (widget, entry->text_area, gc2,
&cursor_location, dir2);
}
}
0,
G_PARAM_READABLE));
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_boxed ("cursor_color",
- _("Cursor color"),
- _("Color with which to draw insertion cursor"),
- GDK_TYPE_COLOR,
- G_PARAM_READABLE));
-
/*
* Key bindings
*/
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor1->height);
- _gtk_draw_insertion_cursor (widget->window, gc1,
+ _gtk_draw_insertion_cursor (widget, widget->window, gc1,
&cursor_location, dir1);
if (gc2)
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor2->height);
- _gtk_draw_insertion_cursor (widget->window, gc2,
+ _gtk_draw_insertion_cursor (widget, widget->window, gc2,
&cursor_location, dir2);
}
}
if (label->select_info->cursor_gc)
gdk_gc_unref (label->select_info->cursor_gc);
- gtk_widget_style_get (GTK_WIDGET (label), "cursor_color", &cursor_color, NULL);
+ gtk_widget_style_get (GTK_WIDGET (label), "cursor-color", &cursor_color, NULL);
label->select_info->cursor_gc = gdk_gc_new (GTK_WIDGET (label)->window);
if (cursor_color)
gdk_gc_set_rgb_fg_color (label->select_info->cursor_gc, cursor_color);
/**
* _gtk_draw_insertion_cursor:
+ * @widget: a #GtkWidget
* @drawable: a #GdkDrawable
* @gc: a #GdkGC
* @location: location where to draw the cursor (@location->width is ignored)
* but merely a convenience function for drawing the standard cursor shape.
**/
void
-_gtk_draw_insertion_cursor (GdkDrawable *drawable,
+_gtk_draw_insertion_cursor (GtkWidget *widget,
+ GdkDrawable *drawable,
GdkGC *gc,
GdkRectangle *location,
GtkTextDirection dir)
{
- gint stem_width = location->height / 30 + 1;
- gint arrow_width = stem_width + 1;
+ gint stem_width;
+ gint arrow_width;
gint x, y;
gint i;
+ gfloat cursor_aspect_ratio;
+ gtk_widget_style_get (widget, "cursor-aspect-ratio", &cursor_aspect_ratio, NULL);
+
+ stem_width = location->height * cursor_aspect_ratio + 1;
+ arrow_width = stem_width + 1;
+
for (i = 0; i < stem_width; i++)
gdk_draw_line (drawable, gc,
location->x + i - stem_width / 2, location->y,
const gchar *string);
#endif /* GTK_DISABLE_DEPRECATED */
-void _gtk_draw_insertion_cursor (GdkDrawable *drawable,
+void _gtk_draw_insertion_cursor (GtkWidget *widget,
+ GdkDrawable *drawable,
GdkGC *gc,
GdkRectangle *location,
GtkTextDirection dir);
cursor_location.height = cursor->height;
gdk_gc_set_clip_rectangle(gc, &clip);
- _gtk_draw_insertion_cursor (drawable, gc, &cursor_location, dir);
+ _gtk_draw_insertion_cursor (widget, drawable, gc, &cursor_location, dir);
gdk_gc_set_clip_rectangle (gc, NULL);
cursor_list = cursor_list->next;
GtkWidget *child);
static void gtk_text_view_forall (GtkContainer *container,
gboolean include_internals,
- GtkCallback callback,
+ GtkCallback callback,
gpointer callback_data);
/* FIXME probably need the focus methods. */
G_PARAM_READWRITE));
- /*
- * Style properties
- */
-
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_boxed ("cursor_color",
- _("Cursor color"),
- _("Color with which to draw insertion cursor"),
- GDK_TYPE_COLOR,
- G_PARAM_READABLE));
-
-
/*
* Signals
*/
if (text_view->cursor_gc)
gdk_gc_unref (text_view->cursor_gc);
- gtk_widget_style_get (GTK_WIDGET (text_view), "cursor_color", &cursor_color, NULL);
+ gtk_widget_style_get (GTK_WIDGET (text_view), "cursor-color", &cursor_color, NULL);
if (!cursor_color)
cursor_color = &red;
_("Width, in pixels, between focus indicator and the widget 'box'."),
0, G_MAXINT, 1,
G_PARAM_READWRITE));
-
+ gtk_widget_class_install_style_property (klass,
+ g_param_spec_boxed ("cursor-color",
+ _("Cursor color"),
+ _("Color with which to draw insertion cursor"),
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (klass,
+ g_param_spec_float ("cursor-aspect-ratio",
+ _("Cursor line aspect ratio"),
+ _("Aspect ratio with which to draw insertion cursor"),
+ 0.0, 1.0, 0.033,
+ G_PARAM_READABLE));
}
static void
# xthickness = 20
GtkButton::child_displacement_x = 1
GtkButton::child_displacement_y = 1
- GtkSpinButton::shadow_type = etched-out
- GtkEntry::cursor_color = "#ff0000"
+ GtkWidget::cursor_color = "#ff0000"
GtkToolbar::space_size = 10
GtkToolbar::space_style = line
GtkToolbar::button_relief = none